oxenstored: perform a 3-way merge of the quota after a transaction
authorJerome Maloberti <jerome.maloberti@citrix.com>
Thu, 3 Jul 2014 14:02:18 +0000 (15:02 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 4 Jul 2014 08:49:09 +0000 (09:49 +0100)
commitf9cff088f470b662df1ac31d1161b4f1870b8546
treef38e956ea741e8c83468ac4bf9dc92051db4f797
parent4ce275826b9816c094225b1117ef3ecbdaba0281
oxenstored: perform a 3-way merge of the quota after a transaction

At a beginning of a transaction, the quotas from the global store
are duplicated and modified by the transaction. If during the
transaction, an action associated to no transaction is concurrently
executed, the quotas of the global store are updated, and then the
updates are lost when the transaction merges.

We fix this problem by keeping another copy of the quota at the
beginning of the transaction, and performing a 3-way merge between
the quotas from the transaction and the "original" copy of the quota
onto the quota of the global store.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Signed-off-by: Euan Harris <euan.harris@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
tools/ocaml/xenstored/quota.ml
tools/ocaml/xenstored/store.ml
tools/ocaml/xenstored/transaction.ml